package FlexTrade;

public class WSAdaptorProxy implements FlexTrade.WSAdaptor {
  private String _endpoint = null;
  private FlexTrade.WSAdaptor wSAdaptor = null;
  
  public WSAdaptorProxy() {
    _initWSAdaptorProxy();
  }
  
  public WSAdaptorProxy(String endpoint) {
    _endpoint = endpoint;
    _initWSAdaptorProxy();
  }
  
  private void _initWSAdaptorProxy() {
    try {
      wSAdaptor = (new FlexTrade.WSAdaptorServiceLocator()).getWSAdaptor();
      if (wSAdaptor != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)wSAdaptor)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)wSAdaptor)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (wSAdaptor != null)
      ((javax.xml.rpc.Stub)wSAdaptor)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public FlexTrade.WSAdaptor getWSAdaptor() {
    if (wSAdaptor == null)
      _initWSAdaptorProxy();
    return wSAdaptor;
  }
  
  public common_classes.WSEvent[] pullWSEvents(java.lang.String _uniqueAuctionID, java.lang.String _customerID) throws java.rmi.RemoteException{
    if (wSAdaptor == null)
      _initWSAdaptorProxy();
    return wSAdaptor.pullWSEvents(_uniqueAuctionID, _customerID);
  }
  
  public boolean receiveNewAuctionRequestFromProvider(common_classes.AuctionPrimitiveData auctionPrimitiveData) throws java.rmi.RemoteException{
    if (wSAdaptor == null)
      _initWSAdaptorProxy();
    return wSAdaptor.receiveNewAuctionRequestFromProvider(auctionPrimitiveData);
  }
  
  public boolean receiveBidPriceFromCustomer(java.lang.String _uniqueAuctionID, common_classes.BidPriceData _bidPriceData) throws java.rmi.RemoteException{
    if (wSAdaptor == null)
      _initWSAdaptorProxy();
    return wSAdaptor.receiveBidPriceFromCustomer(_uniqueAuctionID, _bidPriceData);
  }
  
  public boolean receivePriceAcceptanceFromCustomer(java.lang.String _uniqueAuctionID, common_classes.BidPriceData _bidPriceData) throws java.rmi.RemoteException{
    if (wSAdaptor == null)
      _initWSAdaptorProxy();
    return wSAdaptor.receivePriceAcceptanceFromCustomer(_uniqueAuctionID, _bidPriceData);
  }
  
  public boolean receiveNewAcceptablePriceFromProvider(java.lang.String _uniqueAuctionID, float newAcceptablePrice) throws java.rmi.RemoteException{
    if (wSAdaptor == null)
      _initWSAdaptorProxy();
    return wSAdaptor.receiveNewAcceptablePriceFromProvider(_uniqueAuctionID, newAcceptablePrice);
  }
  
  public common_classes.AuctionPrimitiveData[] getCurrentActiveAuctions() throws java.rmi.RemoteException{
    if (wSAdaptor == null)
      _initWSAdaptorProxy();
    return wSAdaptor.getCurrentActiveAuctions();
  }
  
  public common_classes.AuctionStates getAuctionState(java.lang.String _uniqueAuctionID) throws java.rmi.RemoteException{
    if (wSAdaptor == null)
      _initWSAdaptorProxy();
    return wSAdaptor.getAuctionState(_uniqueAuctionID);
  }
  
  public common_classes.AuctionPrimitiveData getAuctionPrimitiveData(java.lang.String _uniqueAuctionID) throws java.rmi.RemoteException{
    if (wSAdaptor == null)
      _initWSAdaptorProxy();
    return wSAdaptor.getAuctionPrimitiveData(_uniqueAuctionID);
  }
  
  public boolean customerJoinAuction(java.lang.String _uniqueAuctionID, java.lang.String _customerID) throws java.rmi.RemoteException{
    if (wSAdaptor == null)
      _initWSAdaptorProxy();
    return wSAdaptor.customerJoinAuction(_uniqueAuctionID, _customerID);
  }
  
  public boolean authenticateCustomer(java.lang.String username, java.lang.String password) throws java.rmi.RemoteException{
    if (wSAdaptor == null)
      _initWSAdaptorProxy();
    return wSAdaptor.authenticateCustomer(username, password);
  }
  
  public boolean authenticateProvider(java.lang.String username, java.lang.String password) throws java.rmi.RemoteException{
    if (wSAdaptor == null)
      _initWSAdaptorProxy();
    return wSAdaptor.authenticateProvider(username, password);
  }
  
  public boolean addCustomerAccount(java.lang.String username, java.lang.String password) throws java.rmi.RemoteException{
    if (wSAdaptor == null)
      _initWSAdaptorProxy();
    return wSAdaptor.addCustomerAccount(username, password);
  }
  
  public boolean addProviderAccount(java.lang.String username, java.lang.String password) throws java.rmi.RemoteException{
    if (wSAdaptor == null)
      _initWSAdaptorProxy();
    return wSAdaptor.addProviderAccount(username, password);
  }
  
  public boolean paymentTransfer(java.lang.String _uniqueAuctionID, float amount, java.lang.String customerID, java.lang.String providerID) throws java.rmi.RemoteException{
    if (wSAdaptor == null)
      _initWSAdaptorProxy();
    return wSAdaptor.paymentTransfer(_uniqueAuctionID, amount, customerID, providerID);
  }
  
  
}